package com.baizhi.service.impl;

import com.baizhi.dao.AttributeDao;
import com.baizhi.entity.Attribute;
import com.baizhi.service.AttributeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
public class AttributeServiceImpl implements AttributeService {
    @Autowired
    private AttributeDao attributeDao;
    @Override
    @Transactional(readOnly = true)
    public PageInfo<Attribute> selectByPage(Integer page, Integer limit) {
        PageHelper.startPage(page,limit);
        PageInfo<Attribute> pageInfo = new PageInfo<>(attributeDao.selectAll());
        return pageInfo;
    }
}
